
pkgname=serf
pkgver=1.3.9
pkgrel=4
pkgdesc="High-performance asynchronous HTTP client library"
url="https://serf.apache.org/"
arch=('x86_64')
license=('Apache')
depends=('apr' 'apr-util' 'openssl' 'zlib' 'gdbm')
makedepends=('scons')
options=('!libtool')
source=("https://www.apache.org/dist/serf/serf-${pkgver}.tar.bz2"
        'serf-1.3.8-openssl.patch'
        'serf-1.3.8-tests.patch')
md5sums=('370a6340ff20366ab088012cd13f2b57'
         '30af0b6bf39839f3d21327a7a63fac40'
         'cd86cb4302f44f5ef61ec5d3d98a8aca')

build() {
  cd ${pkgname}-${pkgver}
  # adding Gentoo patches
  #patch -p1 -i ${srcdir}/serf-1.3.8-openssl.patch
  #patch -p1 -i ${srcdir}/serf-1.3.8-tests.patch

  scons PREFIX=/usr GSSAPI=/usr/bin/krb5-config
}

check() {
  cd ${pkgname}-${pkgver}
  # Runs: 66 Passes: 52 Fails: 14, loop issue
  scons check
}

package() {
  cd ${pkgname}-${pkgver}
  install -d ${pkgdir}/usr
  
  scons PREFIX=${pkgdir}/usr install
}
